<?php

namespace App\Http\Requests\Admin\V1\CouponTicket;

use App\Http\Requests\ApiRequest;
use App\Models\Coupon\CouponTicket;
use App\Rules\ImageFile;
use Illuminate\Validation\Rule;

/**
 * Class CouponTicketDataRequest
 *
 * @package App\Http\Requests\Admin\V1\Device
 */
class CouponTicketDataRequest extends ApiRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'image'        => ['required', new ImageFile],
            'type'         => ['int', Rule::in(CouponTicket::VALIDATE_TYPES)],
            'title'        => 'required|string',
            'description'  => 'required|string',
            'score'        => 'int',
            'is_available' => 'required|bool',
            'started_at'   => 'required|date',
            'ended_at'     => 'required|date',
            'probability'  => 'required|numeric|max:1|min:0',
            'sort_order'   => 'required|int',
            'code'         => 'string',
        ];
    }
}
